minetest.register_craftitem("lead:lead_lump", {
    description = "Lead Lump",
    inventory_image = "lead_lump.png",
})

minetest.register_craftitem("lead:lead_ingot", {
    description = "Lead Ingot",
    inventory_image = "lead_ingot.png",
})
-- Blei hat einen Schmelzpunkt von 327.5°C also default furnace
minetest.register_craft({
    type = "cooking",
    recipe = "lead:lead_lump",
    output = "lead:lead_ingot",
})

minetest.register_node("lead:stone_with_lead", {
    description = "Lead Ore",
    tiles = {"default_stone.png^lead_mineral_lead.png"},
    groups = {cracky=3},
    sounds = default.node_sound_stone_defaults(),
    drop = "lead:lead_lump",
})

minetest.register_ore({
    ore_type = "scatter",
    ore = "lead:stone_with_lead",
    wherein = "default:stone",
    clust_scarcity = 13*13*13,
    clust_num_ores = 3,
    clust_size = 2,
    y_min = -31000,
    y_max = -10,
})
 
minetest.register_node("lead:lead_block", {
    description = "Lead Block",
    tiles = {"lead_block.png"},
    groups = {cracky=1, level=2},
    sounds = default.node_sound_metal_defaults()
})

minetest.register_craft({
    output = "lead:lead_block",
    recipe = {
        {"lead:lead_ingot", "lead:lead_ingot", "lead:lead_ingot"},
        {"lead:lead_ingot", "lead:lead_ingot", "lead:lead_ingot"},
        {"lead:lead_ingot", "lead:lead_ingot", "lead:lead_ingot"},
    },
})

minetest.register_craft({
    output = "lead:lead_ingot 9",
    recipe = {{"lead:lead_block"}},
})

if minetest.get_modpath("lucky_block") then
    lucky_block:add_blocks({
        {"nod", "lead:lead_block", 0},
        {"nod", "lead:stone_with_lead", 0},
        {"dro", "lead:lead_ingot", 4},
    })
end

if minetest.get_modpath("dungeon_loot") then
    dungeon_loot.register({
        name = "lead:lead_ingot",
        chance = 0.3,
        count = {1, 5},
        y = {-31000, -64},
    })
end
